Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore enhanced stacktraces when libbacktrace is not found #192

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

marcomagdy
Copy link
Contributor

This PR restores the enhanced stack traces (with line numbers and source filenames) even when libbacktrace is not found.
It also ensures that Alpine would continue to work as expected since the package is now not "required".

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Marco Magdy and others added 3 commits December 4, 2023 12:32
This maintains the enhanced stacktraces even if libbacktrace is not
found.
@marcomagdy marcomagdy marked this pull request as ready for review December 4, 2023 23:40
@bmoffatt
Copy link
Collaborator

bmoffatt commented Jan 23, 2024

Trying to test this out - I added a CI workflow with an Alpine 3.19 container - which shows as expected that the crash test no longer passes on newer Alpine since backtrace isn't present. However these test cases fail to build if I merge this branch.

agent_1  | ninja: job failed: /usr/bin/c++ -DAWS_LAMBDA_LOG=3 -Daws_lambda_runtime_EXPORTS -I/codebuild/output/src226519862/src/include -g -std=gnu++11 -fPIC -fno-exceptions -fno-rtti -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Werror -Wconversion -Wno-si
gn-conversion -MD -MT CMakeFiles/aws-lambda-runtime.dir/src/backward.cpp.o -MF CMakeFiles/aws-lambda-runtime.dir/src/backward.cpp.o.d -o CMakeFiles/aws-lambda-runtime.dir/src/backward.cpp.o -c /codebuild/output/src226519862/src/src/backward.cpp
agent_1  | In file included from /codebuild/output/src226519862/src/src/backward.cpp:26:
agent_1  | /codebuild/output/src226519862/src/src/backward.h:262:18: fatal error: execinfo.h: No such file or directory
agent_1  |   262 | #        include <execinfo.h>
agent_1  |       |                  ^~~~~~~~~~~~

Also tried adding apk add elfutils-dev per #124 (comment), but ran into a different error.

agent_1  | ninja: job failed: /usr/bin/c++ -DAWS_LAMBDA_LOG=3 -DBACKWARD_HAS_DW=1 -Daws_lambda_runtime_EXPORTS -I/codebuild/output/src601444743/src/include -g -std=gnu++11 -fPIC -fno-exceptions -fno-rtti -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Werror
-Wconversion -Wno-sign-conversion -MD -MT CMakeFiles/aws-lambda-runtime.dir/src/backward.cpp.o -MF CMakeFiles/aws-lambda-runtime.dir/src/backward.cpp.o.d -o CMakeFiles/aws-lambda-runtime.dir/src/backward.cpp.o -c /codebuild/output/src601444743/src/src/backward.cpp
agent_1  | In file included from /codebuild/output/src601444743/src/src/backward.cpp:26:
agent_1  | /codebuild/output/src601444743/src/src/backward.h:1291:35: error: 'Dl_info' has not been declared
agent_1  |  1291 |     std::string resolve_exec_path(Dl_info& symbol_info) const
agent_1  |       |                                   ^~~~~~~
agent_1  | /codebuild/output/src601444743/src/src/backward.h: In member function 'std::string backward::TraceResolverLinuxBase::resolve_exec_path(int&) const':
agent_1  | /codebuild/output/src601444743/src/src/backward.h:1295:25: error: request for member 'dli_fname' in 'symbol_info', which is of non-class type 'int'
agent_1  |  1295 |         if (symbol_info.dli_fname == argv0_) {
agent_1  |       |                         ^~~~~~~~~
agent_1  | /codebuild/output/src601444743/src/src/backward.h:1308:25: error: request for member 'dli_fname' in 'symbol_info', which is of non-class type 'int'
agent_1  |  1308 |             symbol_info.dli_fname = "/proc/self/exe";
agent_1  |       |                         ^~~~~~~~~
agent_1  | /codebuild/output/src601444743/src/src/backward.h:1312:32: error: request for member 'dli_fname' in 'symbol_info', which is of non-class type 'int'
agent_1  |  1312 |             return symbol_info.dli_fname;
agent_1  |       |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants